package com.sdj.quick.web.controller;

import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.sdj.quick.web.dto.QuickPaymentDto;

@Controller
@RequestMapping("/quick")
public class QuickPayController extends BaseController{

	@RequestMapping("/toQuickPay")
	public String toQuickPay(){
		return "quickPay";
	}
	
	@RequestMapping(value="/quickPay",method=RequestMethod.POST)
	public @ResponseBody String quickPay(QuickPaymentDto quickPaymentDto){
		logger.info("快捷支付发送请求参数对象:【{}】",quickPaymentDto);
		String merKey = quickPaymentDto.getMerKey();
//		quickPaymentDto.setOrderNo(getOrderNo("400"));
		String path = quickConfig.getQuickPayUrl();
		Map<String,String> map = getPostResult(path,merKey,quickPaymentDto);
		return JSON.toJSONString(map);
	}
}
